package services;

import dao.UserDao;
import dao.UserDaoImpl;
import entity.User;

/**
 * @Author:SA
 * @DATA:DATA
 */


public class UserServicesImpl implements UserServices{
    private UserDao userDao = new UserDaoImpl();
    @Override
    public boolean login(User user) {
        //根据用户名和密码 做查询操作
        User usr = userDao.selectUser(user);

        return usr!=null;
    }

    @Override
    public boolean register(User user) {
        //根据用户名和密码 做添加操作
        int i = userDao.addUser(user);
        return i>0;
    }
}
